#ifndef _STMTTYPE_H_
#define _STMTTYPE_H_
#include "SimpleNode.h"
#include "AstTypes.h"
class IVisitor;
class stmtType;
typedef QSharedPointer<stmtType> stmtTypePtr;

class stmtType: public SimpleNode
{
public:
    explicit stmtType(int nodeId=-1);
    virtual ~stmtType();
    
    
    
    virtual Ast::AstTypes type() const;
    virtual QString toString() const;
    virtual void accept(IVisitor* visitor, const SimpleNodePtr& node);
    virtual void traverse(IVisitor* visitor);
private:
};



typedef QListIterator<stmtTypePtr> StmtTypePtrListIterator;

class StmtTypeList: public QList<stmtTypePtr>
{
public:
    inline StmtTypeList() { }
    inline explicit StmtTypeList(stmtTypePtr i) { append(i); }
    inline StmtTypeList(const StmtTypeList &l) : QList<stmtTypePtr>(l) { }
    inline StmtTypeList(const QList<stmtTypePtr> &l) : QList<stmtTypePtr>(l) { }

    inline StmtTypeList operator+(const StmtTypeList &other) const
    { StmtTypeList n = *this; n += other; return n; }
    inline StmtTypeList &operator<<(stmtTypePtr it)
    { append(it); return *this; }
    inline StmtTypeList &operator<<(const StmtTypeList &l)
    { *this += l; return *this; }

    QString toString() const
    {
        QString str("StmtTypeList(");
        foreach(stmtTypePtr it, *this){
            if (it != NULL){
                str += it->toString()+",";
            }
        }
        str += ")";
        return str;
    }

    void traverse(IVisitor* visitor)
    {
        foreach(stmtTypePtr it, *this){
            if (it != NULL){
                it->accept(visitor, it);
            }
        }
    }
};



#endif